package com.blog.web.front;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.blog.model.ResultJSON;
import com.blog.pojo.Article;
import com.blog.pojo.Comment;
import com.blog.service.ArticleService;

/** 
 * @author ant 
 * @date 创建时间：2017年8月29日 上午11:39:53  
 */
@RestController
public class ArticleApiController {
	
	@Autowired
	private ArticleService articleService;
	
	@RequestMapping("/article/comment/{articleId}")
	public ResultJSON saveComment(@PathVariable Integer articleId,Comment comment) {
		Article article = new Article();
		article.setArticleId(articleId);
		comment.setArticle(article);
		comment.setCreateTime(new Date());
		ResultJSON json = articleService.saveComment(comment);
		return json;
	}

}
